package models;

import java.util.List;
import play.Logger;
import play.data.validation.Required;
import com.google.appengine.api.NamespaceManager;
import siena.*;

public class Residence extends BaseModel {

	@Required 
	public String name;
	
	@Required 
	public String descriptionName;
	
	public static Query<Residence> all() {
		return all(Residence.class);
	}
	
	public static int count() {
		return all().count();
	}
	
	public static List<Residence> findAll() {
		return all().fetch();
	}
	
	public static List<Residence> paginate(Query<Residence> query, int offset, int limit) {
		return query.fetch(limit, offset);
	}
	
	public static Residence get(long id) {
		return all().filter("id", id).get();
	}
	
	public static Residence findByName(String name) {
		return all().filter("name", name).get();
	}
	
	
}